package com.gitee.wsl.compose.ext.flow

import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.update

/**
 * Extension function for [MutableState] to update the tick value.
 * Increments the current value by 1 and wraps around at `Int.MAX_VALUE`.
 */

fun MutableStateFlow<Int>.updateTick() {
    update {
        (it + 1) % Int.MAX_VALUE
    }
}
